# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=python-ssh-mitm
_pkgname=ssh_mitm
pkgver=5.0.1
pkgrel=1
pkgdesc='SSH mitm server for security audits supporting public key authentication, session hijacking and file manipulation.'
arch=('any')
groups=('blackarch' 'blackarch-exploitation' 'blackarch-sniffer')
url='https://pypi.org/project/ssh-mitm/#files'
license=('LGPL3')
depends=('python' 'python-paramiko' 'python-pytz' 'python-enhancements'
         'python-requests' 'python-typeguard' 'python-packaging' 'python-rich'
         'python-sshpubkeys' 'python-colored' 'python-pyaml')
makedepends=('python-pip' 'python-build' 'python-wheel')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('b8910cda7fb632124c88fcf1f313c42a87b530e736c6afafba03dd2928cd487883bbd3f801d4913e014b9ab44f3cf66f2a789b26bf55ca43aa4ec0bbaee42637')

build() {
  cd "$_pkgname-$pkgver"

  python -m build --wheel --outdir="$startdir/dist"
}

package() {
  cd "$_pkgname-$pkgver"

  pip install \
    --verbose \
    --disable-pip-version-check \
    --no-warn-script-location \
    --ignore-installed \
    --no-compile \
    --no-deps \
    --root="$pkgdir" \
    --prefix=/usr \
    --no-index \
    --find-links="file://$startdir/dist" \
    $_pkgname
}

